#version 120
uniform vec3 u_eyePosition;
uniform samplerCube u_Cube;

varying vec4 v_Vertex;
varying vec3 v_Normal;

void main() {
    vec3 viewDir = normalize(u_eyePosition - v_Vertex.xyz);
    vec3 reflectViewDir = reflect(viewDir, v_Normal);
    vec3 refractViewDir = refract(viewDir, v_Normal, 0.6);
    vec4 reflectColor = textureCube(u_Cube, reflectViewDir).bgra;
    vec4 refractColor = textureCube(u_Cube, refractViewDir).bgra;
    gl_FragColor = refractColor;
}
